import request from '@/config/request'
import type { PageInfo } from '@/config/types'
import type { LessonSearchForm } from '@/config/form'

export default {
  categories: () => request.get('/front/lesson/category'),
  searchList: (form: LessonSearchForm, pageInfo: PageInfo) =>
    request.post('/front/lesson/', { ...form, ...pageInfo }),
  detail: (id: number) => request.get(`/front/lesson/${id}`),
  chapters: (id: number) => request.get(`/front/lesson/${id}/chapters`),
  ebooks: (id: number) => request.get(`/front/lesson/${id}/ebooks`)
}
